/* eslint-disable @typescript-eslint/no-explicit-any */
/*
 *  Copyright 2021 Collate
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *  http://www.apache.org/licenses/LICENSE-2.0
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

 /**
 * 此模式定义了查询解析器数据的类型
 */
export interface QueryParserData {
    parsedData?: Array<any[] | boolean | number | number | null | ParsedDataObject | string>;
}

export interface ParsedDataObject {
    /**
     * 与查询中的表相关联的数据库
     */
    databaseName?: string;
    /**
     * 与查询相关联的数据库模式
     */
    databaseSchema?: string;
    /**
     * SQL查询执行的日期
     */
    date?: string;
    /**
     * 查询运行时间（秒）
     */
    duration?: number;
    /**
     * 用于检查是否在处理使用情况时应排除查询的标志
     */
    exclude_usage?: boolean;
    /**
     * 将查询的每个已解析表名映射到连接信息
     */
    joins?: { [key: string]: any };
    /**
     * SQL查询类型
     */
    query_type?: string;
    /**
     * 标识此数据库服务的名称
     */
    serviceName: string;
    /**
     * SQL查询
     */
    sql: string;
    /**
     * 查询中使用的表列表
     */
    tables: string[];
    /**
     * 执行SQL查询的用户的名称
     */
    userName?: string;
    [property: string]: any;
}
